#include<bits/stdc++.h>
#define int long long
#define endl "\n"

using namespace std;

signed main() {
	int n, ret = 0;
	cin >> n;
	string s;
	cin >> s;
	for(int i = 0; i < s.size() - 1; i ++ ) {
		if(s[i] == '1' && s[i + 1] == '1') {
			i ++ ;
			ret ++ ;
		}
	}
	cout << ret << endl; 
	return 0;
}

/*
6
111111

*/

